package com.yonyou.iuap.ap.uimeta.config;

import com.yonyou.iuap.uimeta.common.itf.httpclient.MdfUiMetaUnifiedHttpClientItf;
import com.yonyou.iuap.uimeta.common.service.httpclient.IsvMdfUiMetaUnifiedHttpClientServiceImpl;
import com.yonyou.iuap.yms.http.YmsHttpClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @Author: zhuyjh
 * @Date: 2024/5/16 13:47
 */
@AutoConfigureBefore(UiMetaCommonServiceAutoConfiguration.class)
public class IsvUiMetaCommonServiceAutoConfiguration {
    /**
     * http调用工具服务
     *
     * @param ymsHttpClient
     * @return
     */
    @Bean(name = "mdfUiMetaUnifiedHttpClientServiceImpl")
    @ConditionalOnMissingBean(name = "mdfUiMetaUnifiedHttpClientServiceImpl")
    public MdfUiMetaUnifiedHttpClientItf mdfUiMetaUnifiedHttpClientService(@Qualifier("uiMetaUnifiedYmsHttpClient") YmsHttpClient ymsHttpClient) {
        return new IsvMdfUiMetaUnifiedHttpClientServiceImpl(ymsHttpClient);
    }
}